﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GDLIntegration;

namespace Logic
{
    class Program
    {
        //Tester for the queue and XML- Actor declaration reading
        static void Main(string[] args)
        {
            //create test actor
            var shazbot = new Actor("Shazbot", new Traits());    
            shazbot = shazbot.ActorFromXml(@"..\..\XML\Golem.xml");                    
            
            shazbot.Target = new Actor("Bad guy", new Traits());
            shazbot.Target.Target = shazbot;
            shazbot.Target.Stats.Health = 200;
            
            //shazbot.Stats.Health = 200;
            
            //switch on golems
            shazbot.Enable();
            shazbot.Target.Enable();

            Console.WriteLine("|------------------------------------------|\n"
                            + "| Commands to control target of active bot |\n"
                            + "| -----------------------------------------|\n"
                            + "| attack - Makes enemy attack              |\n"
                            + "| block - Makes enemy block                |\n"
                            + "| cast - Makes enemy cast                  |\n"
                            + "| -----------------------------------------|\n"
                            + "| Active bot commands                      |\n"
                            + "| -----------------------------------------|\n"
                            + "| hpcrit - Sets hp to critical amount      |\n"
                            + "| hpres - Resets HP to max                 |\n"
                            + "|------------------------------------------|");

            var cmd = "";
            while (cmd != "exit")
            {
                cmd = Console.ReadLine();
                if (cmd == null)
                {
                    continue;
                }

                if (cmd.StartsWith("hpcrit"))
                {
                    shazbot.Stats.Health = 10;
                }

                if (cmd.StartsWith("hpres"))
                {
                    shazbot.Stats.Health = 200;
                }

                if (cmd.StartsWith("cast"))
                {
                    shazbot.Target.Stance = Actor.Stances.Casting;
                }

                if (cmd.StartsWith("block"))
                {
                    shazbot.Target.Stance = Actor.Stances.Blocking;
                }

                if (cmd.StartsWith("attack"))
                {
                    shazbot.Target.Stance = Actor.Stances.Attacking;
                }
            }

        }
    }
}
